package demo1;

import java.util.Arrays;

public class Sort {
    public static void main(String[] args) {
        //compareable 接口实现排序
        Stu[] stus = new Stu[3];
        stus[0] = new Stu("ccc",12);
        stus[1] = new Stu("aa",16);
        stus[2] = new Stu("bb",14);
        Arrays.sort(stus);
        System.out.println(Arrays.toString(stus));
        System.out.println("*********************");
        Arrays.sort(stus,new NameCopmartor());
        System.out.println(Arrays.toString(stus));
    }
}
